package org.example.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatClientConfiguration {
    @Bean
    public ChatClient chatClient(OllamaChatModel chatModel){
        return ChatClient.builder(chatModel)
                .defaultSystem("你是一名Java程序员，参与过许多项目")
                .defaultAdvisors(new SimpleLoggerAdvisor())
                .build();
    }
}
